/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.weso.acota.strategy;

import java.util.HashSet;
import java.util.Set;

import org.weso.acota.dao.SuggestDAO;
import org.weso.acota.factory.DAOFactory;
import org.weso.acota.to.RequestSuggestionTO;
import org.weso.acota.to.SuggestionTO;
import org.weso.acota.to.TagTO;

/**
 *
 * @author chema
 */
public class DummyAcotaCollectStrategy implements AcotaCollectStrategy{

	
    public DummyAcotaCollectStrategy() {
		super();
	}

	public SuggestionTO suggest(RequestSuggestionTO request, DAOFactory sources) {
		SuggestionTO result = new SuggestionTO();
        Set<TagTO> tags = new HashSet<TagTO>();
        for (SuggestDAO dao : sources.getSuggestDAOs()) {
         //   if(request.getTargetProviders().contains(dao.getProvider())){
            	try {
					tags.addAll(dao.suggest(request).getTags());
				} catch (Exception e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
           // }
        }
        result.setTags(tags);
        return result;
    }

}
